<template>
  <el-dialog
   v-model="dialogVisible"
   title="个人信息"
   :before-close="CloseDia"
   width="70%">
   <el-form v-model="userExtend">
      <el-row :gutter="40">
        <el-col :span="7">
          <el-form-item label="人员类型：">
            {{ userExtend.personType}}
          </el-form-item>
        </el-col>
        <el-col :span="7">
          <el-form-item label="姓名：">
            {{ userExtend.name}}
          </el-form-item>
        </el-col>
        <el-col :span="7">
          <el-form-item label="性别：">
            {{ userExtend.sex==0? '男':userExtend.sex==1?'女':'未知'}}
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="40">
        <el-col :span="7">
          <el-form-item label="证件类型：">
            {{ userExtend.cardType}}
          </el-form-item>
        </el-col>
        <el-col :span="7">
          <el-form-item label="证件号码：">
            {{ userExtend.cardNo}}
          </el-form-item>
        </el-col>
        <el-col :span="7">
          <el-form-item label="出生日期:">
            {{ userExtend.birthDate }}
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="40">
        <el-col :span="7">
          <el-form-item label="年龄:">{{userExtend.age}}</el-form-item>
        </el-col>
        <el-col :span="7">
          <el-form-item label="民族:">
            {{ userExtend.nation }}
          </el-form-item>
        </el-col>
        <el-col :span="7">
          <el-form-item label="政治面貌:">
            {{ userExtend.politicalLandscape }}
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="40">
        <el-col :span="7">
          <el-form-item label="国家/地区:">
            {{ userExtend.country }}
          </el-form-item>
        </el-col>
        <el-col :span="7">
          <el-form-item label="籍贯：">
            {{ nativePlace }}
          </el-form-item>
        </el-col>
        <el-col :span="7">
          <el-form-item label="英语等级：">
            {{ userExtend.englishLevel }}
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="40">
        <el-col :span="7">
          <el-form-item label="现所在单位：">
            {{ userExtend.workCompany }}
          </el-form-item>
        </el-col>
        <el-col :span="7">
          <el-form-item label="紧急联络人：">
            {{ userExtend.secName }}
          </el-form-item>
        </el-col>
        <el-col :span="7">
          <el-form-item label="紧急联络人电话：">
            {{ userExtend.secTel }}
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="40">
        <el-col :span="7">
          <el-form-item label="专业技术职务任职资格:">
            {{ userExtend.zjzwxzdj }}
          </el-form-item>
        </el-col>
        
      </el-row>
      <el-row :gutter="40">
        <el-col :span="7">
          <el-form-item label="首次参加工作日期：">
            {{ userExtend.firstWorkDate }}
          </el-form-item>
        </el-col>
        <el-col :span="7">
          <el-form-item label="最高学历毕业学校:">
            {{ userExtend.highSchool }}
          </el-form-item>
        </el-col>
        <el-col :span="7">
          <el-form-item label="最高学历专业:">
            {{ userExtend.highMajor }}
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="40">
        <el-col>
          <el-form-item label="备注:">
            {{ userExtend.notes }}
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
   </el-dialog>
</template>
<script setup>
import { ref, onActivated, defineEmits, defineProps, computed, watch } from 'vue'
import { getById } from '@/api/common/common'

const dialogVisible = computed(() => props.isShow)

const userExtend = ref({})

const id = computed(() => props.currentId)

const props = defineProps({
  isShow: {
    type: Boolean,
    default: false
  },
  currentId: {
    type: Number
  }
})

const selectFormStore = id => {
  getById(id, 'recruit').then(res => {
    console.log(res)
    userExtend.value = res
  })
}

watch(() => {
  if (id.value) {
    selectFormStore(id.value)
  } else {
    userExtend.value = {}
  }
})

const emits = defineEmits(['onCancel', 'click'])

const CloseDia = () => {
  emits('diaCancel', false)
}
</script>

<style>

</style>
